<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Render EPS Map</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
MathJax = {
	tex: {
		inlineMath: '$', '$'], ['\\(', '\\)'
	},
	svg: {
		fontCache: 'global'
	}
};
</script>
<script type="text/javascript" id="MathJax-script" async
	src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Render EPS Map' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">index</a></li><li><a href="index.html#4">Chapter 4: Spatial Mapping</a></li><li><b>Render EPS Map</b></li></ul></div>
<p class="purpose">To render the spatial map of rooms as an EPS (Encapsulated PostScript) file.</p>

<ul class="toc"><li><a href="4-rem.html#SP2">&#167;2. Writing text in EPS</a></li><li><a href="4-rem.html#SP4">&#167;4. EPS header</a></li><li><a href="4-rem.html#SP5">&#167;5. Circles and rectangles</a></li><li><a href="4-rem.html#SP7">&#167;7. Straight lines</a></li><li><a href="4-rem.html#SP8">&#167;8. Dashed arrows</a></li><li><a href="4-rem.html#SP9">&#167;9. Bezier curves</a></li><li><a href="4-rem.html#SP10">&#167;10. Line thickness</a></li><li><a href="4-rem.html#SP11">&#167;11. Text</a></li><li><a href="4-rem.html#SP12">&#167;12. RGB colours</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>The test case <span class="extract"><span class="extract-syntax">Index-MapEPS-ROTA</span></span> may be useful here: its output is a plain
text file, but simply removing the top line (which contains the test case number)
and then renaming it to have file extension <span class="extract"><span class="extract-syntax">.eps</span></span> should make it a valid EPS
file, which can be opened in Ghostscript, Photoshop or similar.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::render_map_as_EPS</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::render_map_as_EPS</span></span>:<br/>Indexing API - <a href="1-ia.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F_alt</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_session</span><span class="plain-syntax"> *</span><span class="identifier-syntax">session</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">localisation_dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LD</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP10" class="function-link"><span class="function-syntax">Indexing::get_localisation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-sm.html#SP8" class="function-link"><span class="function-syntax">SpatialMap::establish_spatial_coordinates</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rhm.html#SP10" class="function-link"><span class="function-syntax">HTMLMap::compute_room_colours</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_1" class="named-paragraph-link"><span class="named-paragraph">Prepare the EPS levels</span><span class="named-paragraph-number">1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2" class="named-paragraph-link"><span class="named-paragraph">Open a stream and write the EPS map to it</span><span class="named-paragraph-number">1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP1_1" class="paragraph-anchor"></a><b>&#167;1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Prepare the EPS levels</span><span class="named-paragraph-number">1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance_set</span><span class="plain-syntax"> *</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP12" class="function-link"><span class="function-syntax">Indexing::get_set_of_instances</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_1_1" class="named-paragraph-link"><span class="named-paragraph">Create the main EPS map super-level</span><span class="named-paragraph-number">1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">z</span><span class="plain-syntax">=</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">calc</span><span class="plain-syntax">.</span><span class="element-syntax">Universe</span><span class="plain-syntax">.</span><span class="element-syntax">corner1</span><span class="plain-syntax">.</span><span class="identifier-syntax">z</span><span class="plain-syntax">; </span><span class="identifier-syntax">z</span><span class="plain-syntax">&gt;=</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">calc</span><span class="plain-syntax">.</span><span class="element-syntax">Universe</span><span class="plain-syntax">.</span><span class="element-syntax">corner0</span><span class="plain-syntax">.</span><span class="identifier-syntax">z</span><span class="plain-syntax">; </span><span class="identifier-syntax">z</span><span class="plain-syntax">--)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_1_2" class="named-paragraph-link"><span class="named-paragraph">Create an EPS map level for this z-slice</span><span class="named-paragraph-number">1.1.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="2-fi.html#SP10" class="function-link"><span class="function-syntax">FauxInstances::decode_hints</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">changed_global_room_colour</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_1_3" class="named-paragraph-link"><span class="named-paragraph">Inherit EPS room colours from those used in the World Index</span><span class="named-paragraph-number">1.1.3</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_1_1" class="paragraph-anchor"></a><b>&#167;1.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create the main EPS map super-level</span><span class="named-paragraph-number">1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax"> *</span><span class="identifier-syntax">main_eml</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="1-ia.html#SP11" class="function-link"><span class="function-syntax">Indexing::add_EPS_map_levels</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">, </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">width</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"minimum-map-width"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">actual_height</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling_point_size</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::roman</span><span class="plain-syntax">(</span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.EPSMap.DefaultTitle"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_titling</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="4-mc.html#SP4" class="function-link"><span class="function-syntax">ConfigureIndexMap::prepare_map_parameter_scope</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::put_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title"</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">), </span><span class="identifier-syntax">main_eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_1">&#167;1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_1_2" class="paragraph-anchor"></a><b>&#167;1.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an EPS map level for this z-slice</span><span class="named-paragraph-number">1.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eml</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="1-ia.html#SP11" class="function-link"><span class="function-syntax">Indexing::add_EPS_map_levels</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">, </span><span class="identifier-syntax">eml</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_level</span><span class="plain-syntax"> = </span><span class="identifier-syntax">z</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_max</span><span class="plain-syntax"> = -100000, </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_min</span><span class="plain-syntax"> = </span><span class="constant-syntax">100000</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">z</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">y</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_min</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_min</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">y</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_max</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_max</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Str::clear</span><span class="plain-syntax">(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rhm.html#SP12" class="function-link"><span class="function-syntax">HTMLMap::devise_level_rubric</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">z</span><span class="plain-syntax">, </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_titling</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_titling</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="4-mc.html#SP4" class="function-link"><span class="function-syntax">ConfigureIndexMap::prepare_map_parameter_scope</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::put_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle"</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">), </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">z</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">)-&gt;</span><span class="element-syntax">wider_scope</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_1">&#167;1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_1_3" class="paragraph-anchor"></a><b>&#167;1.1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inherit EPS room colours from those used in the World Index</span><span class="named-paragraph-number">1.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::put_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-colour"</span><span class="plain-syntax">, </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">colour</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_1">&#167;1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2" class="paragraph-anchor"></a><b>&#167;1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Open a stream and write the EPS map to it</span><span class="named-paragraph-number">1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">OUT</span><span class="plain-syntax"> = </span><span class="identifier-syntax">F_alt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> </span><span class="identifier-syntax">EPS_struct</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">F_alt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">OUT</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">EPS_struct</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">STREAM_OPEN_TO_FILE</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">, </span><span class="identifier-syntax">ISO_ENC</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::fatal_on_file</span><span class="plain-syntax">(</span><span class="string-syntax">"Can't open index file"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">ifndef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Errors::fatal_with_file</span><span class="plain-syntax">(</span><span class="string-syntax">"can't open index file"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance_set</span><span class="plain-syntax"> *</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP12" class="function-link"><span class="function-syntax">Indexing::get_set_of_instances</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1" class="named-paragraph-link"><span class="named-paragraph">Plot the map itself</span><span class="named-paragraph-number">1.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_2" class="named-paragraph-link"><span class="named-paragraph">Plot all of the rubrics onto the EPS map</span><span class="named-paragraph-number">1.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">F_alt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">STREAM_CLOSE</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1" class="paragraph-anchor"></a><b>&#167;1.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Plot the map itself</span><span class="named-paragraph-number">1.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">blh</span><span class="plain-syntax">, </span><span class="comment-syntax"> total height of the EPS map area (not counting border)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">blw</span><span class="plain-syntax">, </span><span class="comment-syntax"> total width of the EPS map area (not counting border)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">border</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"border-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vskip</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"vertical-spacing"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Compute the dimensions of the EPS map</span><span class="named-paragraph-number">1.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bounding_box_width</span><span class="plain-syntax"> = </span><span class="identifier-syntax">blw</span><span class="plain-syntax">+2*</span><span class="identifier-syntax">border</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounding_box_height</span><span class="plain-syntax"> = </span><span class="identifier-syntax">blh</span><span class="plain-syntax">+2*</span><span class="identifier-syntax">border</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="4-rem.html#SP4" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_header</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounding_box_width</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounding_box_height</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-font"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"map-outline"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Draw a big rectangular outline around the entire EPS map</span><span class="named-paragraph-number">1.2.1.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP11" class="function-link"><span class="function-syntax">Indexing::get_list_of_EPS_map_levels</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eml</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">, </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">map_parameter_scope</span><span class="plain-syntax"> *</span><span class="identifier-syntax">level_scope</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">mapunit</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"grid-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"map-outline"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_3" class="named-paragraph-link"><span class="named-paragraph">Draw an intermediate strut in the big rectangular outline</span><span class="named-paragraph-number">1.2.1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_titling</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_4" class="named-paragraph-link"><span class="named-paragraph">Draw the title for this EPS map level</span><span class="named-paragraph-number">1.2.1.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_level</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_5" class="named-paragraph-link"><span class="named-paragraph">Establish EPS coordinates for this room</span><span class="named-paragraph-number">1.2.1.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_level</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_6" class="named-paragraph-link"><span class="named-paragraph">Draw the map connections from this room as EPS paths</span><span class="named-paragraph-number">1.2.1.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOOP_OVER_FAUX_ROOMS</span><span class="plain-syntax">(</span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_level</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_7" class="named-paragraph-link"><span class="named-paragraph">Draw the boxes for the rooms themselves</span><span class="named-paragraph-number">1.2.1.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2">&#167;1.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_1" class="paragraph-anchor"></a><b>&#167;1.2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compute the dimensions of the EPS map</span><span class="named-paragraph-number">1.2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">total_chunk_height</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">max_chunk_width</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eml</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_BACKWARDS_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">, </span><span class="reserved-syntax">EPS_map_level</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">map_parameter_scope</span><span class="plain-syntax"> *</span><span class="identifier-syntax">level_scope</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">map_parameters</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">mapunit</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"grid-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling_point_size</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">width</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">calc</span><span class="plain-syntax">.</span><span class="element-syntax">Universe</span><span class="plain-syntax">.</span><span class="element-syntax">corner1</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">-</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">calc</span><span class="plain-syntax">.</span><span class="element-syntax">Universe</span><span class="plain-syntax">.</span><span class="element-syntax">corner0</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">+2)*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">actual_height</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">actual_height</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_max</span><span class="plain-syntax">-</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_min</span><span class="plain-syntax">+1)*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">eps_origin</span><span class="plain-syntax"> = </span><span class="identifier-syntax">total_chunk_height</span><span class="plain-syntax"> + </span><span class="identifier-syntax">border</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">height</span><span class="plain-syntax"> = </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">actual_height</span><span class="plain-syntax"> + </span><span class="identifier-syntax">vskip</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">height</span><span class="plain-syntax"> += </span><span class="identifier-syntax">vskip</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_titling</span><span class="plain-syntax">) </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">height</span><span class="plain-syntax"> += </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">titling_point_size</span><span class="plain-syntax">+</span><span class="identifier-syntax">vskip</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">total_chunk_height</span><span class="plain-syntax"> += </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">height</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">max_chunk_width</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">width</span><span class="plain-syntax">) </span><span class="identifier-syntax">max_chunk_width</span><span class="plain-syntax"> = </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">width</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">blh</span><span class="plain-syntax"> = </span><span class="identifier-syntax">total_chunk_height</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">blw</span><span class="plain-syntax"> = </span><span class="identifier-syntax">max_chunk_width</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_2" class="paragraph-anchor"></a><b>&#167;1.2.1.2. </b>The outline is a little like drawing the shape of a bookcase: there's a big
rectangle around the whole thing...
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw a big rectangular outline around the entire EPS map</span><span class="named-paragraph-number">1.2.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"newpath %% Ruled outline outer box of map\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP5" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">border</span><span class="plain-syntax">, </span><span class="identifier-syntax">border</span><span class="plain-syntax">, </span><span class="identifier-syntax">border</span><span class="plain-syntax">+</span><span class="identifier-syntax">blw</span><span class="plain-syntax">, </span><span class="identifier-syntax">border</span><span class="plain-syntax">+</span><span class="identifier-syntax">blh</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"stroke\n"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_3" class="paragraph-anchor"></a><b>&#167;1.2.1.3. </b>...and then there are horizontal shelves dividing it into compartments.
(Each map level will be drawn inside one of these compartments.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw an intermediate strut in the big rectangular outline</span><span class="named-paragraph-number">1.2.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"newpath %% Ruled horizontal line\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP7" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_horizontal_line_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">border</span><span class="plain-syntax">, </span><span class="identifier-syntax">blw</span><span class="plain-syntax">+</span><span class="identifier-syntax">border</span><span class="plain-syntax">, </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">eps_origin</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"stroke\n"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_4" class="paragraph-anchor"></a><b>&#167;1.2.1.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw the title for this EPS map level</span><span class="named-paragraph-number">1.2.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax"> = </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">eps_origin</span><span class="plain-syntax"> + </span><span class="identifier-syntax">vskip</span><span class="plain-syntax"> + </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">actual_height</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">contains_rooms</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">            </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP3" class="function-link"><span class="function-syntax">RenderEPSMap::plot_stream_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">128</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle-font"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">border</span><span class="plain-syntax">*2, </span><span class="identifier-syntax">y</span><span class="plain-syntax">+</span><span class="identifier-syntax">vskip</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"subtitle-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP3" class="function-link"><span class="function-syntax">RenderEPSMap::plot_stream_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">128</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-font"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">border</span><span class="plain-syntax">*2, </span><span class="identifier-syntax">y</span><span class="plain-syntax">+2*</span><span class="identifier-syntax">vskip</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"title-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_5" class="paragraph-anchor"></a><b>&#167;1.2.1.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Establish EPS coordinates for this room</span><span class="named-paragraph-number">1.2.1.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">map_parameter_scope</span><span class="plain-syntax"> *</span><span class="identifier-syntax">room_scope</span><span class="plain-syntax"> = </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="element-syntax">x</span><span class="plain-syntax">-</span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">calc</span><span class="plain-syntax">.</span><span class="element-syntax">Universe</span><span class="plain-syntax">.</span><span class="element-syntax">corner0</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">y</span><span class="plain-syntax">-</span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">y_min</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">offs</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-offset"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">offs</span><span class="plain-syntax">%10000, </span><span class="identifier-syntax">ypart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">offs</span><span class="plain-syntax">/10000;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">5000</span><span class="plain-syntax">) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">-=10000;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &lt; -5000) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">+=10000;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">bx</span><span class="plain-syntax">)*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax"> + </span><span class="identifier-syntax">border</span><span class="plain-syntax"> + </span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/2;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">by</span><span class="plain-syntax">)*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax"> + </span><span class="identifier-syntax">eml</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">eps_origin</span><span class="plain-syntax"> + </span><span class="identifier-syntax">vskip</span><span class="plain-syntax"> + </span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/2;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> += </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">by</span><span class="plain-syntax"> += </span><span class="identifier-syntax">ypart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">eps_x</span><span class="plain-syntax"> = </span><span class="identifier-syntax">bx</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="identifier-syntax">eps_y</span><span class="plain-syntax"> = </span><span class="identifier-syntax">by</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_6" class="paragraph-anchor"></a><b>&#167;1.2.1.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw the map connections from this room as EPS paths</span><span class="named-paragraph-number">1.2.1.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">map_parameter_scope</span><span class="plain-syntax"> *</span><span class="identifier-syntax">room_scope</span><span class="plain-syntax"> = </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP10" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_setting</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"route-thickness"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">eps_x</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="identifier-syntax">eps_y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">)/2;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">R_stiffness</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"route-stiffness"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">dir</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_STORY_DIRECTIONS</span><span class="plain-syntax">(</span><span class="identifier-syntax">dir</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">T</span><span class="plain-syntax"> = </span><a href="4-sm.html#SP21" class="function-link"><span class="function-syntax">SpatialMap::room_exit</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">, </span><span class="identifier-syntax">dir</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">exit</span><span class="plain-syntax"> = </span><span class="identifier-syntax">session</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">story_dir_to_page_dir</span><span class="plain-syntax">[</span><span class="identifier-syntax">dir</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::is_a_room</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_6_1" class="named-paragraph-link"><span class="named-paragraph">Draw a single map connection as an EPS arrow</span><span class="named-paragraph-number">1.2.1.6.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP10" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_unsetting</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_6_1" class="paragraph-anchor"></a><b>&#167;1.2.1.6.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw a single map connection as an EPS arrow</span><span class="named-paragraph-number">1.2.1.6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">T_stiffness</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"route-stiffness"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"route-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax"> == </span><span class="identifier-syntax">Room_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">).</span><span class="identifier-syntax">z</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-sm.html#SP21" class="function-link"><span class="function-syntax">SpatialMap::room_exit</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">, </span><a href="4-sm.html#SP14" class="function-link"><span class="function-syntax">SpatialMap::opposite</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">dir</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">), </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">R</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_6_1_1" class="named-paragraph-link"><span class="named-paragraph">Draw a two-ended arrow for a two-way horizontal connection</span><span class="named-paragraph-number">1.2.1.6.1.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_6_1_2" class="named-paragraph-link"><span class="named-paragraph">Draw a one-way arrow for a distant or off-level connection</span><span class="named-paragraph-number">1.2.1.6.1.2</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_6">&#167;1.2.1.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_6_1_1" class="paragraph-anchor"></a><b>&#167;1.2.1.6.1.1. </b>We don't want to draw this twice (once for R, once for T), so we draw it
just for the earlier-defined room.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw a two-ended arrow for a two-way horizontal connection</span><span class="named-paragraph-number">1.2.1.6.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax"> &lt;= </span><span class="identifier-syntax">T</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP9" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_Bezier_curve</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">R_stiffness</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">, </span><span class="identifier-syntax">T_stiffness</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><span class="identifier-syntax">exit</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">T</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">eps_x</span><span class="plain-syntax">, </span><span class="identifier-syntax">T</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="identifier-syntax">eps_y</span><span class="plain-syntax">, </span><a href="4-sm.html#SP14" class="function-link"><span class="function-syntax">SpatialMap::opposite</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">exit</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_6_1">&#167;1.2.1.6.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_6_1_2" class="paragraph-anchor"></a><b>&#167;1.2.1.6.1.2. </b>A one-way arrow has the destination marked on it textually, since it doesn't
actually go there in any visual way.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw a one-way arrow for a distant or off-level connection</span><span class="named-paragraph-number">1.2.1.6.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">scaled</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">vector</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="4-sm.html#SP13" class="function-link"><span class="function-syntax">SpatialMap::direction_as_vector</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">exit</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax">(</span><span class="identifier-syntax">exit</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">8</span><span class="plain-syntax">:  </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">U_vector_EPS</span><span class="plain-syntax">; </span><span class="identifier-syntax">scaled</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">9</span><span class="plain-syntax">:  </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">D_vector_EPS</span><span class="plain-syntax">; </span><span class="identifier-syntax">scaled</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">10</span><span class="plain-syntax">: </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IN_vector_EPS</span><span class="plain-syntax">; </span><span class="identifier-syntax">scaled</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">11</span><span class="plain-syntax">: </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">OUT_vector_EPS</span><span class="plain-syntax">; </span><span class="identifier-syntax">scaled</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP8" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_dashed_arrow</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">/</span><span class="identifier-syntax">scaled</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP2" class="function-link"><span class="function-syntax">RenderEPSMap::plot_text_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">T</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"annotation-length"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"annotation-font"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">bx</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">*</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">*6/</span><span class="identifier-syntax">scaled</span><span class="plain-syntax">/5, </span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="identifier-syntax">y</span><span class="plain-syntax">*</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">*6/</span><span class="identifier-syntax">scaled</span><span class="plain-syntax">/5,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"annotation-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_6_1">&#167;1.2.1.6.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_7" class="paragraph-anchor"></a><b>&#167;1.2.1.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw the boxes for the rooms themselves</span><span class="named-paragraph-number">1.2.1.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">map_parameter_scope</span><span class="plain-syntax"> *</span><span class="identifier-syntax">room_scope</span><span class="plain-syntax"> = </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_parameters</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">eps_x</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="identifier-syntax">eps_y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">)/2;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_7_1" class="named-paragraph-link"><span class="named-paragraph">Draw the filled box for the room</span><span class="named-paragraph-number">1.2.1.7.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_7_2" class="named-paragraph-link"><span class="named-paragraph">Draw the outline of the box for the room</span><span class="named-paragraph-number">1.2.1.7.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP1_2_1_7_3" class="named-paragraph-link"><span class="named-paragraph">Write in the name of the room</span><span class="named-paragraph-number">1.2.1.7.3</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1">&#167;1.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_7_1" class="paragraph-anchor"></a><b>&#167;1.2.1.7.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw the filled box for the room</span><span class="named-paragraph-number">1.2.1.7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"newpath %% Room interior\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">75</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP6" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_room_boundary_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-shape"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"fill\n\n"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_7">&#167;1.2.1.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_7_2" class="paragraph-anchor"></a><b>&#167;1.2.1.7.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Draw the outline of the box for the room</span><span class="named-paragraph-number">1.2.1.7.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-outline"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP10" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_setting</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">             </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-outline-thickness"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"newpath %% Room outline\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-outline-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP6" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_room_boundary_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-shape"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"stroke\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP10" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_unsetting</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_7">&#167;1.2.1.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1_7_3" class="paragraph-anchor"></a><b>&#167;1.2.1.7.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Write in the name of the room</span><span class="named-paragraph-number">1.2.1.7.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">offs</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name-offset"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">offs</span><span class="plain-syntax">%10000, </span><span class="identifier-syntax">ypart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">offs</span><span class="plain-syntax">/10000;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">5000</span><span class="plain-syntax">) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">-=10000;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &lt; -5000) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">+=10000;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> += </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">by</span><span class="plain-syntax"> += </span><span class="identifier-syntax">ypart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name-colour"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">legend</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">room_to_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">legend</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) { </span><span class="identifier-syntax">room_to_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">; </span><span class="identifier-syntax">legend</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP2" class="function-link"><span class="function-syntax">RenderEPSMap::plot_text_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">legend</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_to_name</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name-length"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><a href="4-mc.html#SP7" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_text_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name-font"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"room-name-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">room_scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2_1_7">&#167;1.2.1.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_2" class="paragraph-anchor"></a><b>&#167;1.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Plot all of the rubrics onto the EPS map</span><span class="named-paragraph-number">1.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">rubric_holder</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rh</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">rh</span><span class="plain-syntax">, </span><span class="reserved-syntax">rubric_holder</span><span class="plain-syntax">, </span><span class="identifier-syntax">faux_set</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">rubrics</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">at_offset</span><span class="plain-syntax">%10000, </span><span class="identifier-syntax">ypart</span><span class="plain-syntax"> = </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">at_offset</span><span class="plain-syntax">/10000;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">mapunit</span><span class="plain-syntax"> = </span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"grid-size"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">5000</span><span class="plain-syntax">) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">-=10000;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">xpart</span><span class="plain-syntax"> &lt; -5000) </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">+=10000;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-mc.html#SP8" class="function-link"><span class="function-syntax">ConfigureIndexMap::get_int_mp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"monochrome"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="4-rem.html#SP13" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">colour</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">O</span><span class="plain-syntax"> = </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">offset_from</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">O</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">O</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="element-syntax">eps_x</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">O</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">fimd</span><span class="plain-syntax">.</span><span class="identifier-syntax">eps_y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">bx</span><span class="plain-syntax"> += </span><span class="identifier-syntax">xpart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100; </span><span class="identifier-syntax">by</span><span class="plain-syntax"> += </span><span class="identifier-syntax">ypart</span><span class="plain-syntax">*</span><span class="identifier-syntax">mapunit</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP2" class="function-link"><span class="function-syntax">RenderEPSMap::plot_text_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">annotation</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">128</span><span class="plain-syntax">, </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">font</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">rh</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">point_size</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">); </span><span class="comment-syntax"> centred both horizontally and vertically</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP1_2">&#167;1.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Writing text in EPS.</b>All of words written on the map &mdash; titles, labels for arrows, rubrics, and so
on &mdash; come from here.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_EPS_TEXT_LENGTH</span><span class="plain-syntax"> </span><span class="constant-syntax">1000</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">MAX_EPS_ABBREVIATED_LENGTH</span><span class="plain-syntax"> </span><span class="constant-syntax">MAX_EPS_TEXT_LENGTH</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::plot_text_at</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::plot_text_at</span></span>:<br/><a href="4-rem.html#SP1_2_1_6_1_2">&#167;1.2.1.6.1.2</a>, <a href="4-rem.html#SP1_2_1_7_3">&#167;1.2.1.7.3</a>, <a href="4-rem.html#SP1_2_2">&#167;1.2.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text_to_plot</span><span class="plain-syntax">, </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">text_to_plot</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_to_plot</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Try taking the name from the printed name property of the room</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP2_2" class="named-paragraph-link"><span class="named-paragraph">If that fails, try taking the name from its source text name</span><span class="named-paragraph-number">2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP3" class="function-link"><span class="function-syntax">RenderEPSMap::plot_stream_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">, </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">, </span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2_1" class="paragraph-anchor"></a><b>&#167;2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Try taking the name from the printed name property of the room</span><span class="named-paragraph-number">2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">printed_name</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">printed_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2" class="paragraph-anchor"></a><b>&#167;2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">If that fails, try taking the name from its source text name</span><span class="named-paragraph-number">2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><a href="2-fi.html#SP13" class="function-link"><span class="function-syntax">FauxInstances::get_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::plot_stream_at</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::plot_stream_at</span></span>:<br/><a href="4-rem.html#SP1_2_1_4">&#167;1.2.1.4</a>, <a href="4-rem.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text_to_plot</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">faux_instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_to_plot</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-rem.html#SP3_1" class="named-paragraph-link"><span class="named-paragraph">Abbreviate the text to be printed by stripping dispensable letters</span><span class="named-paragraph-number">3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP11" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">, </span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">, </span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3_1" class="paragraph-anchor"></a><b>&#167;3.1. </b>The following cuts the text down to the abbreviation length by knocking out,
in sequence: (a) lower-case vowels; (b) spaces; (c) lower-case consonants; (d)
punctuation marks. If that doesn't do it, the text is simply truncated. For
example, "Peisey-Nancroix" abbreviated to 10 is "Pesy-Nncrx" and to 5
is "PsyNn".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Abbreviate the text to be printed by stripping dispensable letters</span><span class="named-paragraph-number">3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">MAX_EPS_ABBREVIATED_LENGTH</span><span class="plain-syntax">) </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax"> = </span><span class="constant-syntax">MAX_EPS_ABBREVIATED_LENGTH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">) &gt; </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">j</span><span class="plain-syntax">=</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)-1; </span><span class="identifier-syntax">j</span><span class="plain-syntax">&gt;=0; </span><span class="identifier-syntax">j</span><span class="plain-syntax">--)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::vowel</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">))) </span><span class="reserved-syntax">goto</span><span class="plain-syntax"> </span><span class="identifier-syntax">RemoveOne</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">j</span><span class="plain-syntax">=</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)-1; </span><span class="identifier-syntax">j</span><span class="plain-syntax">&gt;=0; </span><span class="identifier-syntax">j</span><span class="plain-syntax">--)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">) == </span><span class="character-syntax">' '</span><span class="plain-syntax">) </span><span class="reserved-syntax">goto</span><span class="plain-syntax"> </span><span class="identifier-syntax">RemoveOne</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">j</span><span class="plain-syntax">=</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)-1; </span><span class="identifier-syntax">j</span><span class="plain-syntax">&gt;=0; </span><span class="identifier-syntax">j</span><span class="plain-syntax">--)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::islower</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">))) </span><span class="reserved-syntax">goto</span><span class="plain-syntax"> </span><span class="identifier-syntax">RemoveOne</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">j</span><span class="plain-syntax">=</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">)-1; </span><span class="identifier-syntax">j</span><span class="plain-syntax">&gt;=0; </span><span class="identifier-syntax">j</span><span class="plain-syntax">--)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::isupper</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><span class="reserved-syntax">goto</span><span class="plain-syntax"> </span><span class="identifier-syntax">RemoveOne</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::truncate</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">abbrev_to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RemoveOne:</span><span class="plain-syntax"> </span><span class="identifier-syntax">Str::delete_nth_character</span><span class="plain-syntax">(</span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-rem.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. EPS header.</b>EPS files are identified and version-numbered by a header, as follows.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_header</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_header</span></span>:<br/><a href="4-rem.html#SP1_2_1">&#167;1.2.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bounding_box_width</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bounding_box_height</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">default_font</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">default_point_size</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%%!PS-Adobe EPSF-3.0\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%%%%BoundingBox: 0 0 %d %d\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounding_box_width</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounding_box_height</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%%%%IncludeFont: %S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">default_font</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"/%S findfont %d scalefont setfont\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">default_font</span><span class="plain-syntax">, </span><span class="identifier-syntax">default_point_size</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Circles and rectangles.</b>In EPS files, there's an imaginary pen which traces out "paths". These begin
whenever the pen moves to a new location, and then continue until they are
closed (joined up back to the start position) with a <span class="extract"><span class="extract-syntax">closepath</span></span> command.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_circular_path</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_circular_path</span></span>:<br/><a href="4-rem.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">radius</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d moveto %% rightmost point\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">+</span><span class="identifier-syntax">radius</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d %d %d %d arc %% full circle traced anticlockwise\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">, </span><span class="identifier-syntax">radius</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">360</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"closepath\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span></span>:<br/><a href="4-rem.html#SP1_2_1_2">&#167;1.2.1.2</a>, <a href="4-rem.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y0</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d moveto %% bottom left corner\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d lineto %% bottom side\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d lineto %% right side\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="identifier-syntax">y1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d lineto %% top side\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"closepath\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>The boundary of a room is always one of these:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_room_boundary_path</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_room_boundary_path</span></span>:<br/><a href="4-rem.html#SP1_2_1_7_1">&#167;1.2.1.7.1</a>, <a href="4-rem.html#SP1_2_1_7_2">&#167;1.2.1.7.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">shape</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::cmp</span><span class="plain-syntax">(</span><span class="identifier-syntax">shape</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"square"</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP5" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">bx</span><span class="plain-syntax">-</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">+</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::cmp</span><span class="plain-syntax">(</span><span class="identifier-syntax">shape</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"rectangle"</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP5" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">bx</span><span class="plain-syntax">-2*</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">+2*</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::cmp</span><span class="plain-syntax">(</span><span class="identifier-syntax">shape</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"circle"</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP5" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_circular_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><a href="4-rem.html#SP5" class="function-link"><span class="function-syntax">RenderEPSMap::EPS_compile_rectangular_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">bx</span><span class="plain-syntax">-</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">bx</span><span class="plain-syntax">+</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">boxsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Straight lines.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_horizontal_line_path</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_horizontal_line_path</span></span>:<br/><a href="4-rem.html#SP1_2_1_3">&#167;1.2.1.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d moveto %% LHS\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d lineto %% RHS\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"closepath\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Dashed arrows.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_dashed_arrow</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_dashed_arrow</span></span>:<br/><a href="4-rem.html#SP1_2_1_6_1_2">&#167;1.2.1.6.1.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">length</span><span class="plain-syntax">, </span><span class="reserved-syntax">vector</span><span class="plain-syntax"> </span><span class="identifier-syntax">Dir</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"[2 1] 0 setdash %% dashed line for arrow\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d moveto %% room centre\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d rlineto %% arrow out\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Dir</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">*</span><span class="identifier-syntax">length</span><span class="plain-syntax">, </span><span class="identifier-syntax">Dir</span><span class="plain-syntax">.</span><span class="identifier-syntax">y</span><span class="plain-syntax">*</span><span class="identifier-syntax">length</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"stroke\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"[] 0 setdash %% back to normal solid lines\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. Bezier curves.</b>The other sort of path we'll need is a Bézier curve, a quadratic curve which
interpolates between vectors. EPS has support for these built-in; see any
reference book on PostScript.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_Bezier_curve</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_Bezier_curve</span></span>:<br/><a href="4-rem.html#SP1_2_1_6_1_1">&#167;1.2.1.6.1.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">stiffness0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">stiffness1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">exit0</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">exit1</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_session</span><span class="plain-syntax"> *</span><span class="identifier-syntax">session</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cx1</span><span class="plain-syntax">, </span><span class="identifier-syntax">cy1</span><span class="plain-syntax">, </span><span class="identifier-syntax">cx2</span><span class="plain-syntax">, </span><span class="identifier-syntax">cy2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">vector</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="4-sm.html#SP13" class="function-link"><span class="function-syntax">SpatialMap::direction_as_vector</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">exit0</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">cx1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">x0</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">*</span><span class="identifier-syntax">stiffness0</span><span class="plain-syntax">/100; </span><span class="identifier-syntax">cy1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">y0</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="identifier-syntax">y</span><span class="plain-syntax">*</span><span class="identifier-syntax">stiffness0</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="4-sm.html#SP13" class="function-link"><span class="function-syntax">SpatialMap::direction_as_vector</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">exit1</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">cx2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">x1</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="element-syntax">x</span><span class="plain-syntax">*</span><span class="identifier-syntax">stiffness1</span><span class="plain-syntax">/100; </span><span class="identifier-syntax">cy2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">y1</span><span class="plain-syntax">+</span><span class="identifier-syntax">E</span><span class="plain-syntax">.</span><span class="identifier-syntax">y</span><span class="plain-syntax">*</span><span class="identifier-syntax">stiffness1</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d moveto %% start of Bezier curve\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x0</span><span class="plain-syntax">, </span><span class="identifier-syntax">y0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d %d %d %d %d curveto %% control points 1, 2 and end\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">cx1</span><span class="plain-syntax">, </span><span class="identifier-syntax">cy1</span><span class="plain-syntax">, </span><span class="identifier-syntax">cx2</span><span class="plain-syntax">, </span><span class="identifier-syntax">cy2</span><span class="plain-syntax">, </span><span class="identifier-syntax">x1</span><span class="plain-syntax">, </span><span class="identifier-syntax">y1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"stroke\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. Line thickness.</b>The following routines should be used in nested pairs, so that the PostScript
stack is kept in order.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_setting</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_setting</span></span>:<br/><a href="4-rem.html#SP1_2_1_6">&#167;1.2.1.6</a>, <a href="4-rem.html#SP1_2_1_7_2">&#167;1.2.1.7.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">new</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"currentlinewidth %% Push old line width onto stack\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d setlinewidth\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">new</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_unsetting</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_line_width_unsetting</span></span>:<br/><a href="4-rem.html#SP1_2_1_6">&#167;1.2.1.6</a>, <a href="4-rem.html#SP1_2_1_7_2">&#167;1.2.1.7.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"setlinewidth %% Pull old line width from stack\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Text.</b>In EPS world, text is just another sort of path.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_text</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_text</span></span>:<br/><a href="4-rem.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"/%S findfont %d scalefont setfont\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">font</span><span class="plain-syntax">, </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"newpath (%S)\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">centre_h</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"dup stringwidth add 2 div %d exch sub %% = X centre-offset\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %% = X\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">centre_v</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %d 2 div sub %% = Y centre-offset\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">, </span><span class="identifier-syntax">pointsize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d %% = Y\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">y</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"moveto show\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. RGB colours.</b>Inform internally stores colours as six hexadecimal digits, in traditional
HTML way: <span class="extract"><span class="extract-syntax">RRGGBB</span></span>, with each colour from 0 to 255. In EPS files, colours
are written as triples of floating point numbers \(0 \leq b \leq 1\).
</p>

<p class="commentary">EPS uses reverse Polish notation, so the command here is: <span class="extract"><span class="extract-syntax">R G B setrgbcolor</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_set_colour</span></span>:<br/><a href="4-rem.html#SP1_2_1_4">&#167;1.2.1.4</a>, <a href="4-rem.html#SP1_2_1_6_1">&#167;1.2.1.6.1</a>, <a href="4-rem.html#SP1_2_1_7_1">&#167;1.2.1.7.1</a>, <a href="4-rem.html#SP1_2_1_7_2">&#167;1.2.1.7.2</a>, <a href="4-rem.html#SP1_2_1_7_3">&#167;1.2.1.7.3</a>, <a href="4-rem.html#SP1_2_2">&#167;1.2.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">) != </span><span class="constant-syntax">6</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"Colour '%S'\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"Improper HTML colour"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::choose_colour_beam</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">), </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::choose_colour_beam</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">), </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">3</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::choose_colour_beam</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">4</span><span class="plain-syntax">), </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">, </span><span class="constant-syntax">5</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"setrgbcolor %% From HTML colour %S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">htmlcolour</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::choose_colour_beam</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">hex1</span><span class="plain-syntax">, </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">hex2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::hex_to_int</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">hex1</span><span class="plain-syntax">)*16 + </span><a href="4-rem.html#SP12" class="function-link"><span class="function-syntax">RenderEPSMap::hex_to_int</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">hex2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%.6g "</span><span class="plain-syntax">, (</span><span class="reserved-syntax">double</span><span class="plain-syntax">) (((</span><span class="reserved-syntax">float</span><span class="plain-syntax">) </span><span class="identifier-syntax">k</span><span class="plain-syntax">)/255.0));</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::hex_to_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">hex</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax">(</span><span class="identifier-syntax">hex</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'0'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'1'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'2'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'3'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'4'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">4</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'5'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">5</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'6'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">6</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'7'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">7</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'8'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">8</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'9'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">9</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'a'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'A'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">10</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'b'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'B'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">11</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'c'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'C'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">12</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'d'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'D'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">13</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'e'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'E'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">14</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'f'</span><span class="plain-syntax">: </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="character-syntax">'F'</span><span class="plain-syntax">: </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">15</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">default:</span><span class="plain-syntax"> </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"Improper character in HTML colour"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>EPS also supports greyscale, where there's only one beam:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span><button class="popup" onclick="togglePopup('usagePopup15')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup15">Usage of <span class="code-font"><span class="function-syntax">RenderEPSMap::EPS_compile_set_greyscale</span></span>:<br/><a href="4-rem.html#SP1_2_1_4">&#167;1.2.1.4</a>, <a href="4-rem.html#SP1_2_1_6_1">&#167;1.2.1.6.1</a>, <a href="4-rem.html#SP1_2_1_7_1">&#167;1.2.1.7.1</a>, <a href="4-rem.html#SP1_2_1_7_2">&#167;1.2.1.7.2</a>, <a href="4-rem.html#SP1_2_1_7_3">&#167;1.2.1.7.3</a>, <a href="4-rem.html#SP1_2_2">&#167;1.2.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%0.02f setgray %% greyscale %d/100ths of white\n"</span><span class="plain-syntax">, (</span><span class="reserved-syntax">float</span><span class="plain-syntax">) </span><span class="identifier-syntax">N</span><span class="plain-syntax">/100, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-rhm.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-il.html">2</a></li><li class="progresschapter"><a href="3-tpt.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-mc.html">mc</a></li><li class="progresssection"><a href="4-sg.html">sg</a></li><li class="progresssection"><a href="4-sm.html">sm</a></li><li class="progresssection"><a href="4-rhm.html">rhm</a></li><li class="progresscurrent">rem</li><li class="progressnextoff">&#10095;</li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

